//package com.bestcem.xm.award.controller;
//
//import com.bestcem.xm.award.service.GrpcPlatformService;
//import com.bestcem.xm.award.service.dto.draw.PageDTO;
//import com.bestcem.xm.award.service.dto.grpcplatform.CreateGrpcPlatformParam;
//import com.bestcem.xm.award.service.dto.grpcplatform.GrpcPlatformDTO;
//import com.bestcem.xm.common.core.grpcplatform.entity.ListGrpcPlatformsParam;
//import com.bestcem.xm.common.core.grpcplatform.entity.UpdateGrpcPlatformParam;
//import com.bestcem.xm.common.core.domain.web.ResultJson;
//import com.bestcem.xm.common.core.constant.RegTypes;
//import com.bestcem.xm.common.core.domain.web.ServiceResult;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.*;
//
//import javax.validation.Valid;
//import javax.validation.constraints.NotBlank;
//import javax.validation.constraints.Pattern;
//
///**
// * grpc鉴权配置操作接口
// *
// * @author sh.pei <sh.pei@idiaoyan.com>
// * @version v1.0
// * @date 2021/7/21 17:32
// */
//public class GrpcPlatformController {
//
//    @Autowired
//    private GrpcPlatformService grpcPlatformService;
//
//    /**
//     * 列表查询grpc平台配置数据
//     *
//     * @param param
//     * @return
//     */
//    @PostMapping(path = "/list", consumes = MediaType.APPLICATION_JSON_VALUE)
//    public ResultJson<PageDTO<GrpcPlatformDTO>> listGrpcPlatforms(@RequestBody @Valid ListGrpcPlatformsParam param) {
//        ServiceResult<PageDTO<GrpcPlatformDTO>> result = grpcPlatformService.listGrpcPlatforms(param);
//        return ResultJson.handelServiceResult(result);
//    }
//
//    /**
//     * 根据id查询grpc平台配置数据
//     *
//     * @param id
//     * @return
//     */
//    @GetMapping("/{id}")
//    public ResultJson<GrpcPlatformDTO> getGrpcPlatform(
//            @PathVariable("id")
//            @NotBlank(message = "平台标识不能为空")
//            @Pattern(regexp = RegTypes.OBJECT_ID, message = "平台标识错误") String id) {
//        ServiceResult<GrpcPlatformDTO> grpcPlatform = grpcPlatformService.getGrpcPlatform(id);
//        return ResultJson.handelServiceResult(grpcPlatform);
//    }
//
//    /**
//     * 创建grpc平台配置数据
//     *
//     * @param param
//     * @return
//     */
//    @PostMapping(path = "/", consumes = MediaType.APPLICATION_JSON_VALUE)
//    public ResultJson<String> createGrpcPlatform(@RequestBody @Valid CreateGrpcPlatformParam param) {
//        ServiceResult<String> grpcPlatform = grpcPlatformService.createGrpcPlatform(param);
//        return ResultJson.handelServiceResult(grpcPlatform);
//    }
//
//    /**
//     * 更新grpc平台配置数据
//     *
//     * @param param
//     * @return
//     */
//    @PutMapping("/{id}")
//    public ResultJson<String> updateGrpcPlatform(@PathVariable("id")
//                                                 @NotBlank(message = "平台标识不能为空")
//                                                 @Pattern(regexp = RegTypes.OBJECT_ID, message = "平台标识错误") String id,
//                                                 @RequestBody @Valid UpdateGrpcPlatformParam param) {
//        ServiceResult<String> result = grpcPlatformService.updateGrpcPlatform(id, param);
//        return ResultJson.handelServiceResult(result);
//    }
//
//    /**
//     * 删除grpc平台配置数据
//     *
//     * @return
//     */
//    @DeleteMapping("/{id}")
//    public ResultJson deleteGrpcPlatform(@PathVariable("id")
//                                         @NotBlank(message = "平台标识不能为空")
//                                         @Pattern(regexp = RegTypes.OBJECT_ID, message = "平台标识错误") String id) {
//        ServiceResult result = grpcPlatformService.deleteGrpcPlatform(id);
//        return ResultJson.handelServiceResult(result);
//    }
//}
